package IOStream;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

//缓存字符输入流 按行读取字符串
public class BRDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("src/IOStream/BRDemo.java");

        InputStreamReader isr=new InputStreamReader(fis,"UTF-8");

        BufferedReader br=new BufferedReader(isr);

        String str=null;

        //readLine  连续读取若干个字符串 直到读取到换换行符
        //返回值为null 表示读到了文件末尾
        while ((str=br.readLine())!=null){
            System.out.println(str);
        }

        br.close();

    }

}
